package com.sjh;

/**
 * @author jack
 * @data 2020/8/21 3:30 下午
 */
public class TraditionalSynchronizeThread {
    public static void main(String[] args) {
        OutPut outPut = new OutPut();
        while (true) {
            new Thread(new Runnable(){

                @Override
                public void run() {
                    outPut.outPut("jackLove");
                }
            }).start();

            new Thread(new Runnable(){

                @Override
                public void run() {
                    outPut.outPut("TraditionalSynchronizeThread");
                }
            }).start();
        }
        }

    static class OutPut{
        public synchronized void outPut(String name) {
            for (int i = 0; i < name.length(); i++) {
                System.out.print(name.charAt(i));
            }
            System.out.println();
        }

    }
}

